def get_month_day(year,month):
    get_day = [0,31,28,31,30,31,30,31,31,30,31,30,31]
    if year % 4 == 0 and year % 100 != 0 or year % 400 == 0:
        if month == 2:
            return 29

    return get_day[month]

year = int(input("请输入年份："))
month = int(input("请输入月份："))
if month not in range(1,13):
    print("请输入有效的月份！")

day = get_month_day(year,month)
print(f"{year}年{month}月有{day}天")

